Skip to content

feat: runner-agnostic BDD layer (two-go/bdd)#14

Merged
tugkanboz merged 1 commit into
mainfrom
feature/bdd
Jun 3, 2026
Merged

feat: runner-agnostic BDD layer (two-go/bdd)#14
tugkanboz merged 1 commit into
mainfrom
feature/bdd

Conversation

@tugkanboz

Copy link
Copy Markdown
Member

Closes #13.

Graduates the BDD helper from the examples into the package, decoupled from any runner.

  • given / when / then / and build step objects that share a world.
  • scenario(steps) returns an async function you hand to your runner's test() (node:test, Jest, Vitest, Mocha). It imports no runner.
  • feature(name, scenarios) builds a labelled, runnable list.
  • Exposed only via the two-go/bdd subpath, deliberately not from the main entry, so a then export does not make import('two-go') thenable.
  • Types, 6 unit tests, README section, CHANGELOG.

630 unit tests green, tsc clean, no em dashes.

Add given/when/then/and, scenario(steps), and feature(...) under the two-go/bdd
subpath. scenario returns an async function for your runner's test(), steps
share a world, and it imports no runner so it works with node:test, Jest,
Vitest, and Mocha. Kept off the main entry so the package namespace is not made
thenable by a 'then' export. Types, tests, README, CHANGELOG.
@tugkanboz tugkanboz merged commit 11a2632 into main Jun 3, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a runner-agnostic BDD layer (two-go/bdd)

1 participant